import datetime
import time


now = time.localtime()
print(now)


now = datetime.datetime.now()
now.strftime('%Y-%m-%d')

now = datetime.datetime.strptime(now.strftime('%Y-%m-%d'),'%Y-%m-%d')
print(now)

for i in range(31):
    begin_date = now - datetime.timedelta(days=i)
    end_date = now - datetime.timedelta(days=(i - 1))
    print(begin_date,end_date)